package engine.mail;

import java.util.Collection;

import org.springframework.core.io.Resource;

import com.google.appengine.api.mail.MailService.Header;
import com.google.appengine.api.mail.MailService.Message;

import engine.content.IContent;

public class GoogleMailMessageWrapper implements IMailMessage<Message> {

	Message message;
	
	public GoogleMailMessageWrapper(Message m) {
		this.setMessage(m);
	}

	@Override
	public void setSender(String sender) throws Exception {
		message.setSender(sender);
	}


	@Override
	public void setTo(Collection<String> to) throws Exception {
		message.setTo(to);
	}


	@Override
	public void setSubject(String subject) throws Exception {
		message.setSubject(subject);
	}


	@Override
	public void setHtmlBody(String htmlBody) throws Exception {
		message.setHtmlBody(htmlBody);
	}


	@Override
	public void addHeader(String header, String value) throws Exception {
		Header mailHeader = new Header(header, value);
		message.setHeaders(mailHeader);
	}

	@Override
	public Message getMessage() {
		return this.message;
	}

	@Override
	public void setMessage(Message message) {
		this.message = message;
	}

	@Override
	public void setReplyTo(String replyTo) throws Exception {
		message.setReplyTo(replyTo);
	}

	@Override
	public void addAttachment(IContent content, Resource res,
			IMailMessage message, String fileName, String fileId)
			throws Exception {
		// TODO Auto-generated method stub
		
	}
	

}
